package com.rc.pojo.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class AddressTableDef extends TableDef {

    /**
     * 用户地址表 实体类。

 @author 27806
 @since 2024-06-15
     */
    public static final AddressTableDef ADDRESS = new AddressTableDef();

    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 市
     */
    public final QueryColumn CITY = new QueryColumn(this, "city");

    /**
     * 县/区
     */
    public final QueryColumn TOWN = new QueryColumn(this, "town");

    public final QueryColumn CON_ID = new QueryColumn(this, "con_id");

    /**
     * 手机
     */
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 详细地址
     */
    public final QueryColumn STREET = new QueryColumn(this, "street");

    /**
     * 联系人
     */
    public final QueryColumn CONTACT = new QueryColumn(this, "contact");

    /**
     * 省
     */
    public final QueryColumn PROVINCE = new QueryColumn(this, "province");

    /**
     * 是否是默认 1默认 0否
     */
    public final QueryColumn IS_DEFAULT = new QueryColumn(this, "is_default");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, CITY, TOWN, CON_ID, PHONE, STREET, CONTACT, PROVINCE, IS_DEFAULT};

    public AddressTableDef() {
        super("rc", "address");
    }

    private AddressTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public AddressTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new AddressTableDef("rc", "address", alias));
    }

}
